package utils

import (
	"log"

	"github.com/spf13/viper"
)

func ConfigInit() {
	viper.SetConfigFile("./config/conf.yaml")
	if err := viper.ReadInConfig(); err != nil {
		log.Println("读取配置文件错误！" + err.Error())
	}
	Mysqldns = viper.GetString("mysql.root") + ":" +
		viper.GetString("mysql.passwd") +
		"@tcp(" + viper.GetString("mysql.addr") +
		")/" + viper.GetString("mysql.databases") +
		viper.GetString("mysql.default")
	//fmt.Println(mysqldns)
	//fmt.Println(Mysqldns)
}

var (
	Mysqldns    string //mysql连接数据
)
